package com.xiaoma.controller;

import com.xiaoma.component.SmsComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import utils.BizCodeEnum;
import utils.R;

/**
 * @Author: xiaoma
 * @Date: 2021/7/15 9:49
 * @description:
 */
@RestController
@RequestMapping("/sms")
@Slf4j
public class SmsSendController {
    @Autowired
    private SmsComponent smsComponent;

    /*** 提供给别的服务进行调用的
     该controller是发给短信服务的，不是验证的
     */
    @GetMapping("/sendcode")
    public R sendCode(@RequestParam("phone") String phone, @RequestParam("code") String code){
      smsComponent.sendSmsCode(phone,code);
      return R.ok();
    }
}
